<%@page contentType="text/html;charset=UTF-8" language = "java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<html>
	<head>
		<title>
			JWiki 管理
		</title>
	</head>
	<body>
		<center>
		<h2><br> </h2><h2>用户管理 </h2>
		<br>
			<table align="center">
			<tr align="center">
			<td><a href="admin.do?page=main">管理主页</a></td>
			<td><a href="admin.do?page=useradmin">管理用户</a></td>
			<td><a href="admin.do?page=itemadmin">管理词条</a></td>			
			</tr>
			</table>
		<hr>
			<font color = 'blue'>用户列表</font>			
		</center>
		<br>		
		<form name = "form1" method = "post" action = "admin.do?page=useradmin&action=delete">
		<c:if test="${afterdel == 1}">
		<c:set var="afterdel" value="${afterdel-1}" scope="session"/>
			<p align = "center">已经删除用户：</p>
			<table width = "50%" border = "0" align = "center" bordercolor = "white" bgcolor = "white" cellpadding = "0">				
				<tr bgcolor = "grey" align = "center">
					<td></td>
					<td>权限</td>
					<td>用户名</td>
					<td>姓名</td>
					<td>地址</td>
					<td>电话</td>
					<td>邮件</td>
				</tr>
				<c:forEach items="${deleted}" var="item">
					<tr bgcolor = "red" align = "center">
						<td></td>
						<td>用户</td>
						<td><c:out value="${item.username}"/></td>
						<td><c:out value="${item.name}"/></td>
						<td><c:out value="${item.address}"/></td>
						<td><c:out value="${item.phone}"/></td>
						<td><c:out value="${item.email}"/></td>
					</tr>
				</c:forEach>
			</table>
			<p align = "center">现有用户如下：</p>
		</c:if>
			<table width = "50%" border = "0" align = "center" bordercolor = "white" bgcolor = "white" cellpadding = "0">
				<tr bgcolor = "#CCFF22" align = "center">
					<td>选中</td>
					<td>权限</td>
					<td>用户名</td>
					<td>姓名</td>
					<td>地址</td>
					<td>电话</td>
					<td>邮件</td>
				</tr>
				<c:set var="cmpstr" value="管理员" />
				<c:forEach items="${userlist}" var="item">
					<tr bgcolor = "lightsteelblue" align = "center">
						<td>
						<c:choose>
						<c:when test="${item.userType==cmpstr}"></c:when>
						<c:otherwise><input type = "checkbox" name = "beselected" value =<c:out value="${item.username}"/> >
						</c:otherwise>						
						</c:choose>
						</td>
						<td><c:out value="${item.userType}"/></td>
						<td><c:out value="${item.username}"/></td>
						<td><c:out value="${item.name}"/></td>
						<td><c:out value="${item.address}"/></td>
						<td><c:out value="${item.phone}"/></td>
						<td><c:out value="${item.email}"/></td>
					</tr>
				</c:forEach>		
	</table>	
	<br>
	<br>
	<center>
					<input type = "submit" value = "删除选中">			
	</center>
				</form>
	</body>
</html>